/**
 * <copyright>
 * </copyright>
 *

 */
package de.rwth.adroidGuiLang.util;

import de.rwth.adroidGuiLang.*;

import java.util.List;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;

/**
 * <!-- begin-user-doc -->
 * The <b>Switch</b> for the model's inheritance hierarchy.
 * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
 * to invoke the <code>caseXXX</code> method for each class of the model,
 * starting with the actual class of the object
 * and proceeding up the inheritance hierarchy
 * until a non-null result is returned,
 * which is the result of the switch.
 * <!-- end-user-doc -->
 * @see de.rwth.adroidGuiLang.AdroidGuiLangPackage
 * @generated
 */
public class AdroidGuiLangSwitch<T>
{
  /**
   * The cached model package
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected static AdroidGuiLangPackage modelPackage;

  /**
   * Creates an instance of the switch.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AdroidGuiLangSwitch()
  {
    if (modelPackage == null)
    {
      modelPackage = AdroidGuiLangPackage.eINSTANCE;
    }
  }

  /**
   * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @return the first non-null result returned by a <code>caseXXX</code> call.
   * @generated
   */
  public T doSwitch(EObject theEObject)
  {
    return doSwitch(theEObject.eClass(), theEObject);
  }

  /**
   * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @return the first non-null result returned by a <code>caseXXX</code> call.
   * @generated
   */
  protected T doSwitch(EClass theEClass, EObject theEObject)
  {
    if (theEClass.eContainer() == modelPackage)
    {
      return doSwitch(theEClass.getClassifierID(), theEObject);
    }
    else
    {
      List<EClass> eSuperTypes = theEClass.getESuperTypes();
      return
        eSuperTypes.isEmpty() ?
          defaultCase(theEObject) :
          doSwitch(eSuperTypes.get(0), theEObject);
    }
  }

  /**
   * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @return the first non-null result returned by a <code>caseXXX</code> call.
   * @generated
   */
  protected T doSwitch(int classifierID, EObject theEObject)
  {
    switch (classifierID)
    {
      case AdroidGuiLangPackage.WINDOW:
      {
        Window window = (Window)theEObject;
        T result = caseWindow(window);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.BOX:
      {
        Box box = (Box)theEObject;
        T result = caseBox(box);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.ONE_COLUMN_BOX:
      {
        OneColumnBox oneColumnBox = (OneColumnBox)theEObject;
        T result = caseOneColumnBox(oneColumnBox);
        if (result == null) result = caseBox(oneColumnBox);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.TWO_COLUMN_BOX:
      {
        TwoColumnBox twoColumnBox = (TwoColumnBox)theEObject;
        T result = caseTwoColumnBox(twoColumnBox);
        if (result == null) result = caseBox(twoColumnBox);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.TWO_COLUMN_LINE:
      {
        TwoColumnLine twoColumnLine = (TwoColumnLine)theEObject;
        T result = caseTwoColumnLine(twoColumnLine);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.THREE_COLUMN_BOX:
      {
        ThreeColumnBox threeColumnBox = (ThreeColumnBox)theEObject;
        T result = caseThreeColumnBox(threeColumnBox);
        if (result == null) result = caseBox(threeColumnBox);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.THREE_COLUMN_LINE:
      {
        ThreeColumnLine threeColumnLine = (ThreeColumnLine)theEObject;
        T result = caseThreeColumnLine(threeColumnLine);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.RADIO_BOX:
      {
        RadioBox radioBox = (RadioBox)theEObject;
        T result = caseRadioBox(radioBox);
        if (result == null) result = caseBox(radioBox);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.SEPERATOR_LINE:
      {
        SeperatorLine seperatorLine = (SeperatorLine)theEObject;
        T result = caseSeperatorLine(seperatorLine);
        if (result == null) result = caseBox(seperatorLine);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.RADIO_BUTTON:
      {
        RadioButton radioButton = (RadioButton)theEObject;
        T result = caseRadioButton(radioButton);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.CHECKED_RADIO_BUTTON:
      {
        CheckedRadioButton checkedRadioButton = (CheckedRadioButton)theEObject;
        T result = caseCheckedRadioButton(checkedRadioButton);
        if (result == null) result = caseRadioButton(checkedRadioButton);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.UNCHECKED_RADIO_BUTTON:
      {
        UncheckedRadioButton uncheckedRadioButton = (UncheckedRadioButton)theEObject;
        T result = caseUncheckedRadioButton(uncheckedRadioButton);
        if (result == null) result = caseRadioButton(uncheckedRadioButton);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.GUI_ELEMENT:
      {
        GuiElement guiElement = (GuiElement)theEObject;
        T result = caseGuiElement(guiElement);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.BUTTON:
      {
        Button button = (Button)theEObject;
        T result = caseButton(button);
        if (result == null) result = caseGuiElement(button);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.PLACEHOLDER:
      {
        Placeholder placeholder = (Placeholder)theEObject;
        T result = casePlaceholder(placeholder);
        if (result == null) result = caseGuiElement(placeholder);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.IMAGE:
      {
        Image image = (Image)theEObject;
        T result = caseImage(image);
        if (result == null) result = caseGuiElement(image);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.CHECK_BOX:
      {
        CheckBox checkBox = (CheckBox)theEObject;
        T result = caseCheckBox(checkBox);
        if (result == null) result = caseGuiElement(checkBox);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.CHECKED_CHECK_BOX:
      {
        CheckedCheckBox checkedCheckBox = (CheckedCheckBox)theEObject;
        T result = caseCheckedCheckBox(checkedCheckBox);
        if (result == null) result = caseCheckBox(checkedCheckBox);
        if (result == null) result = caseGuiElement(checkedCheckBox);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.UNCHECKED_CHECK_BOX:
      {
        UncheckedCheckBox uncheckedCheckBox = (UncheckedCheckBox)theEObject;
        T result = caseUncheckedCheckBox(uncheckedCheckBox);
        if (result == null) result = caseCheckBox(uncheckedCheckBox);
        if (result == null) result = caseGuiElement(uncheckedCheckBox);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.LABEL:
      {
        Label label = (Label)theEObject;
        T result = caseLabel(label);
        if (result == null) result = caseGuiElement(label);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case AdroidGuiLangPackage.EDIT_TEXT:
      {
        EditText editText = (EditText)theEObject;
        T result = caseEditText(editText);
        if (result == null) result = caseGuiElement(editText);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      default: return defaultCase(theEObject);
    }
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Window</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Window</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseWindow(Window object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Box</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Box</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseBox(Box object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>One Column Box</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>One Column Box</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseOneColumnBox(OneColumnBox object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Two Column Box</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Two Column Box</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseTwoColumnBox(TwoColumnBox object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Two Column Line</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Two Column Line</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseTwoColumnLine(TwoColumnLine object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Three Column Box</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Three Column Box</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseThreeColumnBox(ThreeColumnBox object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Three Column Line</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Three Column Line</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseThreeColumnLine(ThreeColumnLine object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Radio Box</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Radio Box</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseRadioBox(RadioBox object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Seperator Line</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Seperator Line</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseSeperatorLine(SeperatorLine object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Radio Button</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Radio Button</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseRadioButton(RadioButton object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Checked Radio Button</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Checked Radio Button</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseCheckedRadioButton(CheckedRadioButton object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Unchecked Radio Button</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Unchecked Radio Button</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseUncheckedRadioButton(UncheckedRadioButton object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Gui Element</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Gui Element</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseGuiElement(GuiElement object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Button</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Button</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseButton(Button object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Placeholder</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Placeholder</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T casePlaceholder(Placeholder object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Image</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Image</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseImage(Image object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Check Box</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Check Box</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseCheckBox(CheckBox object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Checked Check Box</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Checked Check Box</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseCheckedCheckBox(CheckedCheckBox object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Unchecked Check Box</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Unchecked Check Box</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseUncheckedCheckBox(UncheckedCheckBox object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Label</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Label</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseLabel(Label object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Edit Text</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Edit Text</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseEditText(EditText object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch, but this is the last case anyway.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject)
   * @generated
   */
  public T defaultCase(EObject object)
  {
    return null;
  }

} //AdroidGuiLangSwitch
